package com.wxpay.demo.model;

import lombok.Data;


/**
 * app预下单对象
 * https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=9_1
 * 具体的参数可根据需要自行扩展
 * 使用建造者模式，可以避免new 对象一些繁琐的set看的不清晰
 */
@Data
public class PreOrderRequest {

    private String appid;
    private String mchId;
    private String nonceStr;
    private String sign;
    private String body;
    private String outTradeNo;
    private Integer totalFee;
    private String spbillCreateIp;
    private String notifyUrl;
    private String tradeType;


    private PreOrderRequest(){}

    public static PreOrderRequest  create(){
        return new PreOrderRequest();
    }

    public PreOrderRequest  buildAppId(String appid){
        this.appid=appid;
        return this;
    }

    public PreOrderRequest  buildMchId(String mchId){
        this.mchId=mchId;
        return this;
    }

    public PreOrderRequest  buildNonceStr(String nonceStr){
        this.nonceStr=nonceStr;
        return this;
    }

    public PreOrderRequest  buildSign(String sign){
        this.sign=sign;
        return this;
    }

    public PreOrderRequest  buildBody(String body){
        this.body=body;
        return this;
    }

    public PreOrderRequest  buildOutTradeNo(String outTradeNo){
        this.outTradeNo=outTradeNo;
        return this;
    }

    public PreOrderRequest  buildTotalFee(Integer totalFee){
        this.totalFee=totalFee;
        return this;
    }

    public PreOrderRequest  buildSpbillCreateIp(String spbillCreateIp){
        this.spbillCreateIp=spbillCreateIp;
        return this;
    }

    public PreOrderRequest  buildNotifyUrl(String notifyUrl){
        this.notifyUrl=notifyUrl;
        return this;
    }

    public PreOrderRequest  buildTradeType(String tradeType){
        this.tradeType=tradeType;
        return this;
    }


}
